const backgroundColor='#45415a';


//leftTop
$.ajax({
	type:"get",
	url:"Public/Home/data/left-top.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createLeftTopChart(dataJson);
	}
});


//leftBottom
$.ajax({
	type:"get",
	url:"Public/Home/data/left-bottom.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createleftBottomChart(dataJson);
	}
});

//rightTop
$.ajax({
	type:"get",
	url:"Public/Home/data/right-top.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createRightTopChart(dataJson);
	}
});


$.ajax({
	type:"get",
	url:"Public/Home/data/right-bottom.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createRightBottomChart(dataJson);
	}
});


$.ajax({
	type:"get",
	url:"Public/Home/data/chinaMap.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createChinaMapChart(dataJson);
	}
});












/*
var  timingDataVue= new Vue({
  el: '#center',
  data: {
  	sumDealMoney:"",
  	orderQuantity:"",
  	rangeTime:"",
  	list:[]
  }
})
var sumDealMoney;
var orderQuantity;
$.ajax({
	type:"get",
	url:"data/initValue.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createInitValue(dataJson);
	}
});
function createInitValue(data){
	var currentData=data[0];
	
	sumDealMoney=formatToNum(currentData.initDealMoney);
	orderQuantity=formatToNum(currentData.initOrderQuantity);

	
	timingDataVue.sumDealMoney=numFormat(sumDealMoney);
	timingDataVue.orderQuantity=numFormat(orderQuantity);
	timingDataVue.rangeTime=currentData.rangeTime;
}


$.ajax({
	type:"get",
	url:"data/storeDeal.txt",
	async:true,
	success:function(data){
		data=data.replace(/,\s*]/g,']');
		var dataJson=JSON.parse(data);
		createStoreDealList(dataJson);
	}
});


function createStoreDealList(data){
	timingDataVue.list=data;
}





$(function() {
    //获得当前<ul>
    var $uList = $(".timing-card .list");
    var timer = null;
    //触摸清空定时器
    $uList.hover(function() {
        clearInterval(timer);
    },
    function() { //离开启动定时器
        timer = setInterval(function() {
            scrollList($uList);
        },
        1000);
    }).trigger("mouseleave"); //自动触发触摸事件
    //滚动动画
    function scrollList(obj) {
        //获得当前<li>的高度
        var scrollHeight = $(".timing-card .item").height();
        //滚动出一个<li>的高度
        $uList.stop().animate({
            marginTop: -scrollHeight
        },
        900,
        function() {
            //动画结束后，将当前<ul>marginTop置为初始值0状态，再将第一个<li>拼接到末尾。
            $uList.css({
                marginTop: 0
            }).find(".item:first").appendTo($uList);
        });
       
    }
});



function timingChangeData(){
	var randomTime=(Math.random()*10+10)*1000;
	setTimeout(function(){
		var addMoney=parseInt(Math.random()*19800+200);
		var addQuantity=parseInt(Math.random()*3+1);
		
		sumDealMoney+=addMoney;
		orderQuantity+=addQuantity;
		timingDataVue.sumDealMoney=numFormat(sumDealMoney);
  		timingDataVue.orderQuantity=numFormat(orderQuantity);
		timingChangeData();
	},randomTime);
}
timingChangeData();*/